package com.vdongchina.miniapp.service;

import com.vdongchina.miniapp.commons.MiniAppException;
import com.vdongchina.miniapp.http.dto.*;

/**
 * Copyright (C)
 * FileName: AppPayService
 * Author:   maokai
 * Date:     2021/8/13 17:07
 * Description:
 */
public interface IAppPayService {
    /**
     * 支付下单
     *
     * @param request
     */

    CreateOrderResp.Data createOrder(CreateOrderRequest request) throws MiniAppException;

    /**
     * 订单查询
     *
     * @param request
     */
    
     QueryOrderResp queryOrder(QueryOrderRequest request) throws MiniAppException;

    /**
     * 退款请求
     *
     * @param request
     */
    
     String createRefund(CreateRefundRequest request) throws MiniAppException;

    /**
     * 查询退款
     *
     * @param request
     */

    QueryRefundResp.RefundInfo  queryRefund(QueryRefundRequest request) throws MiniAppException;

    /**
     * 分账
     *
     * @param request
     */
    
     boolean settle(SettleRequest request) throws MiniAppException;

    /**
     * 查询分账
     *
     * @param request
     */

    QuerySettleResp.SettleInfo querySettle(QuerySettleRequest request) throws MiniAppException;

    /**
     * 担保交易账单查询
     *
     * @param startDate 开始时间，格式：20210603
     * @param endDate   结束时间，格式：20210603
     * @param seller    商户号
     * @param billType  账单类型，包括 payment:支付账单, settle:分账账单, refund:退款账单
     * @param appId     和商户号绑定的 appid 或者 thirdparty_id
     * @param sign      对上面的参数进行签名
     */
    
     String bill(String startDate, String endDate, String seller, String billType, String appId) throws MiniAppException;
}
